package server;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;

import com.google.appengine.api.urlfetch.HTTPResponse;
import com.google.appengine.api.urlfetch.URLFetchService;
import com.google.appengine.api.urlfetch.URLFetchServiceFactory;

import controller.Utils;

public class Test {
	public static void Te() throws MalformedURLException, InterruptedException, ExecutionException
	{
		URLFetchService fetcher = URLFetchServiceFactory.getURLFetchService();

		URL urlDomain = new URL("http://www.markosweb.com./www/google.com");
		Future fDomain = fetcher.fetchAsync(urlDomain);

		HTTPResponse response = (HTTPResponse) fDomain.get();
		 
		Document doc = Jsoup.parse(new String(response.getContent()));
		
		System.out.println(doc.select(".column script").toString());
	}
	public static void main(String[] args) throws MalformedURLException, InterruptedException, ExecutionException {
		String domain = "13240590.vkrugudruzei.ru";
		System.out.println(Utils.returnSubDomainTo(domain));
	}
}
